package com.junit;

import java.util.List;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.sjzl.dao.impl.DaoImpl;
import com.sjzl.entity.Board;
import com.sjzl.entity.User;

public class BoardTest {
	
	@Test
	public void main(){
		ApplicationContext ac = new ClassPathXmlApplicationContext(
				new String[] { "applicationContext.xml" });
		DaoImpl dao = (DaoImpl) ac.getBean("daoImpl");
		
		Board board = (Board) dao.get(Board.class, 6);
		System.out.println(board.getName());
		List<User> users = board.getModerators();
		/*for(User u : users){
			System.out.println(u.getAccount());
		}*/
		System.out.println(users.size());
		
	}
	
}
